#! /usr/bin/env python
# encoding: utf-8
top = '.'
out = 'build'

def hello(ctx):
    print('hello world')

def ping(ctx):
    print('ping from '+ctx.path.abspath())
    ctx.recurse('src')

def pong(ctx):
    print(' -- pong! %d'%id(ctx))

def options(ctx):
    ctx.add_option('--foo', action='store', default=False, help='Silly test')

def configure(ctx):
    
    print('configuring the project in ' + ctx.path.abspath())
    print(' the value of foo is %r' % ctx.options.foo)
    
    ctx.env.TXT=str(ctx.options.foo)+'.txt'
    print "Configured TXT to be: [%s]"%ctx.env.TXT
    ctx.find_program('touch')
    ctx.find_program('cp')

    print '-----------'
    print ctx.env
    print '-----------'
    print ctx 

def build(ctx):
    print 'target is: [%s]'%ctx.env.TXT
    ctx(rule='${TOUCH} ${TGT}', target=ctx.env.TXT)
    ctx(rule='${CP} ${SRC} ${TGT}',source=ctx.env.TXT,target=ctx.env.TXT+'.copy')
